package cn.hanna.springcloudalibaba.service.impl;

import cn.hanna.springcloudalibaba.dao.AccountMapper;
import cn.hanna.springcloudalibaba.service.AccountService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @author smileha
 * @create 2021-10-23 1:14
 * @description
 */
@Service
@Slf4j
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountMapper accountMapper;

    @Override
    public void decrease(Long userId, BigDecimal money) {
        log.info("-------------->账户微服务开始修改用户余额啦");
        accountMapper.decrease(userId,money);
        log.info("-------------->账户微服务修改用户余额完成");
    }
}
